﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Threading;
//using System.Threading.Tasks;
//using Volo.Abp.EntityFrameworkCore;
//using Xms.Abp.Storage;
//using Ef = Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions;

//namespace FeatureManagement;

//public class EfCoreFeatureValueRepository : XmsEfCoreRepository<IFeatureManagementStorage, FeatureValue, Guid>, IFeatureValueRepository
//{
//    public EfCoreFeatureValueRepository(IDbContextProvider<IFeatureManagementStorage> dbContextProvider)
//        : base(dbContextProvider)
//    {
//    }

//    public virtual async Task<FeatureValue> FindAsync(
//        string name,
//        string providerName,
//        string providerKey,
//        CancellationToken cancellationToken = default)
//    {
//        return await Ef.FirstOrDefaultAsync((await GetDbSetAsync()).OrderBy(x => x.Id) , s => s.Name == name && s.ProviderName == providerName && s.ProviderKey == providerKey, GetCancellationToken(cancellationToken));
//    }

//    public async Task<List<FeatureValue>> FindAllAsync(
//        string name,
//        string providerName,
//        string providerKey,
//        CancellationToken cancellationToken = default)
//    {
//        return await Ef.ToListAsync((await GetDbSetAsync())
//            .Where(
//                s => s.Name == name && s.ProviderName == providerName && s.ProviderKey == providerKey
//            ), GetCancellationToken(cancellationToken));
//    }

//    public virtual async Task<List<FeatureValue>> GetListAsync(
//        string providerName,
//        string providerKey,
//        CancellationToken cancellationToken = default)
//    {
//        return await Ef.ToListAsync((await GetDbSetAsync())
//            .Where(s => s.ProviderName == providerName && s.ProviderKey == providerKey), GetCancellationToken(cancellationToken));
//    }
//}
